package com.xncoding.pos.init;

import com.xncoding.pos.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * ：使用 @Component + 非静态成员变量中转
 * @description:
 * @author: bo
 * @create: 2025-04-07 16:00
 */
@Component
public class StaticUtils1 {
    private static UserService staticService;

    @Autowired
    private UserService userService;

    @PostConstruct
    public void init() {
        staticService = userService;
    }

    public static void doSomething() {
        staticService.getList();
    }
}